import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPoolConfig;

import java.util.HashSet;

public class Client {

    public static void main(String[] args) {
        JedisPoolConfig config = new JedisPoolConfig();
        HashSet<HostAndPort> jedisClusterNodes = new HashSet<>();
        jedisClusterNodes.add(new HostAndPort("192.168.160.132", 7001));
        jedisClusterNodes.add(new HostAndPort("192.168.160.132", 7002));
        jedisClusterNodes.add(new HostAndPort("192.168.160.132", 7003));
        jedisClusterNodes.add(new HostAndPort("192.168.160.132", 7004));
        jedisClusterNodes.add(new HostAndPort("192.168.160.132", 7005));
        jedisClusterNodes.add(new HostAndPort("192.168.160.132", 7006));
        JedisCluster jedisCluster = new JedisCluster(jedisClusterNodes, config);
        jedisCluster.set("name:111", "000");
        String value = jedisCluster.get("name:111");
        System.out.println("key->name:111, value->" + value);
    }
}
